﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace CIT.WMS
{
    public partial class FrmLogin : Form
    {
        public FrmLogin()
        {
            InitializeComponent();
        }

        private void btn_login_Click(object sender, EventArgs e)
        {

            var userid = this.txtUserID.Text;
            var password = this.txtPassword.Text;
            var ck = this.dd_CK.SelectedText;
            if (string.IsNullOrEmpty(userid))
            {
                this.lab_msg.Text = "用户ID不可为空";
                return;
            }
            else if (string.IsNullOrEmpty(password))
            {
                this.lab_msg.Text = "密码不可为空";
                return;
            }
            else if (string.IsNullOrEmpty(ck))
            {
                this.lab_msg.Text = "仓库不可为空";
                return;
            }

            if (!ValidateUser(userid, password))
            {
                this.lab_msg.Text = "用户名密码不正确";
                return;
            }
            else
            {

            }

        }

        public bool ValidateUser(string userId, string password)
        {
            var result = false;
            if (userId.Equals(password))
            {
                result = true;
            }
            return result;
        }
    }
}